package com.xhwl.centiotdata.suppliersystem.eesd.iotnorth;

import com.xhwl.centiotdata.handler.eesd.impl.EesdIotNorthHandler;
import com.xhwl.common.dto.cent.energy.EesdElectricDetailDTO;
import com.xhwl.common.pojo.cent.device.DeviceProjSupplierCategory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author xh_lwy
 * @description: 调用测试
 * @date 2022/9/1610:58
 */
@RestController
@RequestMapping("/pullIotData")
public class IotPost {
    @Autowired
    private IotNorthHandler iotNorthHandler;
    @Resource
    private EesdIotNorthHandler eesdIotNorthHandler;


    @PostMapping("/test1")
    public List<EesdElectricDetailDTO> test(@RequestBody DeviceProjSupplierCategory config){
        return iotNorthHandler.getIotDataByCode(config);
    }


    // 同步水电表数据到设备中台
    @PostMapping("/test4")
    public void test4(@RequestBody DeviceProjSupplierCategory config) {
        eesdIotNorthHandler.pullIotNorthYDZJDevices(config);
    }

    // 同步水电表iot平台设备影子属性数据
    @PostMapping("/test5")
    public void test5(@RequestBody DeviceProjSupplierCategory config) {
        eesdIotNorthHandler.pullIotNorthData(config);
    }
}
